<!-- index首页 -->
<template>
  <div id="index" class="index">
    <ul>
      <li v-for="(item, index) in links" :key="index">
        <a @click="$goRoute(item.route)">{{ item.text }}</a>
      </li>
      <router-view />
    </ul>
  </div>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      links: [
        {
          text: "胡萝卜",
          route: "/home"
        },
        {
          text: "大白菜",
          route: "/page01"
        },
        {
          text: "水蜜桃",
          route: "/page02"
        },
        {
          text: "map",
          route: "/map"
        }
      ]
    };
  }
};
</script>
<style scoped></style>
